public class DecoratorDemo {
    public static void main(String[] args) {
        Component component = new ConcreteComponent();
        component = new ConcreteDecoratorA(component);
        component = new ConcreteDecoratorB(component);

        component.operate(); // 输出 "ConcreteComponent operate." 后跟 "ConcreteDecoratorA behavior." 和 "ConcreteDecoratorB behavior."
    }
}
